home *** CD-ROM | disk | FTP | other *** search
/ Serving Financial Service…olutions Suite 1994 Fall / Serving Financial Services Solutions Suite 1994 Fall.iso / GS_Apps / eXTRASCAN.app / install_issd6 < prev    next >
Text File  |  1994-12-14  |  4KB  |  137 lines

  1. #!/bin/csh -f
  2.  
  3. # Usage install_issd6
  4. # Last modified Sun Apr  3 17:11:28 EDT 1994
  5. # install_issd6 does the following:
  6. # 1. Check to see if issd6 is installed in /etc/inetd.conf
  7. #    If it is then comment it out.
  8. # 2. Kill all running locald6's and issd6's 
  9. # 3. Copy the latest issd6 and locald6 into old versions.
  10. # 4. Install issd6 in /etc/rc.local
  11. #
  12.  
  13.  
  14. # Standard system files
  15. set INETD_FILE = "/etc/inetd.conf"
  16. set RCLOCAL = "/etc/rc.local"
  17.  
  18. # Standard directory for Apps
  19. set STANDARD_DIRS = "/LocalApps"
  20.  
  21. # Current version of XNet License daemons you are using.
  22. set VERSION = 66
  23.  
  24. # List of commands
  25. set PS = "/bin/ps"
  26. set MV = "/bin/mv"
  27. set CP = "/bin/cp"
  28. set GREP = "/bin/grep"
  29. set KILL = "/bin/kill"
  30. set SED = "/bin/sed"
  31. set CHMOD = "/bin/chmod"
  32. set BM = "/usr/bin/bm"
  33. set AWK = "/bin/awk"
  34.  
  35. #********* 1 *************
  36.  
  37. echo ".....Checking ${INETD_FILE}....."
  38. set inet = `$GREP 300162/2 ${INETD_FILE}`
  39. if ($#inet != 0) then
  40.   $SED -e "/300162\/2/ d" < ${INETD_FILE} > ${INETD_FILE}.iss
  41.   $MV ${INETD_FILE} ${INETD_FILE}.preiss
  42.   $MV ${INETD_FILE}.iss ${INETD_FILE}
  43.   echo "${INETD_FILE} was altered to remove old versions of issd6"
  44.   echo "The old ${INETD_FILE} has been saved in ${INETD_FILE}.preiss"
  45.   echo "We recommend sending a signal to inetd to reread this file"
  46.   echo -n "If you do not wish to do this, please enter No --> "
  47.   set input = $<
  48.   if ($input != "No") then
  49.     echo  "Restarting inetd"
  50.     set pid = `$PS acux | $GREP inetd`
  51.     $KILL -HUP $pid[2]
  52.   endif
  53. endif
  54. echo ".....Done....."
  55. echo "------------------------------------------------------------------"
  56. echo ""
  57.  
  58. #********* 2 ****************************
  59. # Kill all existing locald6's and issd6's
  60.  
  61. # Kill all issd6's.
  62. $KILL -9 `$PS acx|$BM issd6|$AWK '{ print $1 }'`
  63.  
  64. # Kill all locald6's.
  65. $KILL -9 `$PS acx|$BM locald6|$AWK '{ print $1 }'`
  66.  
  67. #**************** 3 ****************************
  68. # Replacing old versions of issd6 and locald6
  69.  
  70. echo "We recommend replacing old versions of the daemons issd6 and locald6"
  71. echo "to prevent conflicts from occurring"
  72. echo -n "Would you like us to do this automatically [y/n]  -->"
  73. set input = $<
  74. if ($input != "y") then
  75.    echo "Please replace any old versions of locald6 or issd6 with the"
  76.    echo "newer versions of locald6 and issd6"
  77.    echo "------------------------------------------------------------------"
  78.    echo ""
  79. else
  80.    echo ".....Replacing old versions of issd6 and locald6....."
  81.    echo -n "Please enter places other than $STANDARD_DIRS that I should look -->"
  82.    set input = $<
  83.    set DIRS = "$STANDARD_DIRS $input"
  84.    echo $DIRS
  85.    foreach dir ($DIRS)
  86.      if (-e $dir) then
  87.         find $dir -name locald6   -ok $CP ./locald6 {} \;
  88.         find $dir -name issd6     -ok $CP ./issd6 {} \;
  89.      else
  90.         echo "$dir does not exist"
  91.      endif
  92.    end
  93.    echo ".....Done....."
  94.    echo "------------------------------------------------------------------"
  95.    echo ""
  96. endif
  97.  
  98.  
  99. #******* This section actually installs issd6 *****************
  100. #******* 4 ****************************************************
  101.  
  102. if ($1 == "") then
  103.   set ISSDDIR = `pwd`
  104. else
  105.   set ISSDDIR = $1
  106. endif
  107. set num_words = `$GREP -c issd6 ${RCLOCAL}`
  108. if ($num_words != 0) then
  109.    set versiongrep = `$GREP XNet ${RCLOCAL}`
  110.    if ($#versiongrep == 0) then
  111.       set oldversion = 0
  112.    else
  113.       set oldversion = $versiongrep[2]
  114.    endif
  115.    if ($oldversion < $VERSION) then
  116.       echo "Older version of issd6 already installed in ${RCLOCAL}"
  117.       echo "New version is backward compatible with older licensing"
  118.       echo -n "Replace old version with newer version? [y/n] -->"
  119.       set input = $<
  120.       if ($input == "y") then
  121.         echo ".....Installing issd6....."
  122.         $SED -e "/issd6/ d" -e "/$versiongrep/ d" < $RCLOCAL > ${RCLOCAL}.iss
  123.         $MV ${RCLOCAL} ${RCLOCAL}.preiss
  124.         $MV ${RCLOCAL}.iss ${RCLOCAL}
  125.     ${CHMOD} 755 ${RCLOCAL}
  126.     echo  "# $VERSION XNet Licensing--do not edit this line" >>& ${RCLOCAL}
  127.     echo  "${ISSDDIR}/issd6 -i" >>& ${RCLOCAL}
  128.         ${ISSDDIR}/issd6 -i
  129.         echo ".....Done....."
  130.       endif
  131.    else
  132.       echo "issd6 has already been installed"
  133.       ${ISSDDIR}/issd6 -i
  134.       exit
  135.    endif
  136. endif
  137.